/* 员工管理模块相关的API */

import request from "@/request/request";
import {getUserInfoAPI} from "@/api/userApi";

/* 获取员工列表的接口 */
export const getEmployeesAPI = (params) => {
  return request({
    url: '/sys/user',
    method: 'GET',
    params
  })
}

/* 删除员工的接口 */
export const deleteEmployeesAPI = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'DELETE'
  })
}

/* 添加员工的接口 */
export const addEmployeesAPI = (data) => {
  return request({
    url: `/sys/user`,
    method: 'POST',
    data,
  })
}

/* 批量导入员工的接口 */
export const importExcelAPI = (data) => {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

/* 修改员工基本信息的接口 */
export const updateUserInfoAPI = (data) => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}

/* 获取所有角色列表的接口  */
export const getRoleListAPI = () => {
  return request({
    url:'/sys/role',
    method:'GET'
  })
}

/* 分工分配角色的接口 */
export const assignRolesAPI = (data) => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}
